package com.raymond.smgp.msg.tlv;

/**
 * TLVByte
 *
 * @author :  raymond
 * @version :  V1.0
 * @date :  2021-08-06 14:57
 */
public class TLVByte extends TLV {
	private byte value = 0;

	public TLVByte(short tag) {
		this(tag, (byte) 0);
	}

	public TLVByte(short tag, byte value) {
		super(tag);
		this.value = value;

	}

	public void setValue(byte value) {
		this.value = value;
	}

	public byte getValue() {
		return value;
	}

	@Override
	public byte[] getValueData() {
		return new byte[] { getValue() };
	}

	@Override
	public void setValueData(byte[] valueData) {
		setValue(valueData[0]);
	}

	@Override
	public short getLength() {
		return 1;
	}


}